package Interface;

public class MammalInt implements Animal {

    public String name;
    @Override
    public void eat() {
        System.out.println("MammalInt eat");
    }

    @Override
    public void travel() {
        System.out.println("MammalInt travel");
    }

    public void setName(String sname) {
        this.name=sname;
    }

    /**
     * 重写接口默认实现方法
     * @param args
     */
    @Override
    public void defaultMethod(){
		System.out.println("我是MammalInt defaultMethod");
	}
    
    public static void main(String[] args) {
        MammalInt model = new MammalInt();
        model.eat();
        model.travel();
        model.setName("123qwe");
        model.defaultMethod();
        Animal animal = (Animal)model;//实现转接口
        Animal.staticMethod();//接口静态方法
        System.out.println(model.name);


    }
}
